package com.sjz.bookmark.listener;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.vfs.VirtualFile;

public class AddBookmarkAction extends AnAction {
    @Override
    public void actionPerformed(AnActionEvent e) {
        Editor editor = e.getData(CommonDataKeys.EDITOR);
        if (editor != null) {
            int lineNumber = editor.getCaretModel().getLogicalPosition().line + 1;
            VirtualFile file = FileDocumentManager.getInstance().getFile(editor.getDocument());
            
            // 创建并显示添加书签对话框
        }
    }
}